<template>
    <h1>用户登录列表页面</h1>

    <table class="table table-bordered" border="1">
        <thead >
            <tr>
                <th>账号ID</th>
                <th>账号</th>
                <th>密码</th>
                <th>注册时间</th>
            </tr>
        </thead>

        <tbody>
            <tr v-for=" item in Show ">
                <td>{{ item.L_Id }}</td>
                <td>{{ item.L_Name }}</td>
                <td>{{ String(item.L_Pwd.substring(0,4)+'***')  }}</td>
                <td>{{ item.DateTime.substring(0,10) }}</td>
            </tr>
        </tbody>

    </table>

</template>

<script setup lang="ts">

import { ref,onMounted } from 'vue';
import axios from 'axios';

const Show = ref([{
    L_Id:'',
    L_Name:'',
    L_Pwd:'',
    DateTime:''
}])

onMounted(()=>{
    ShowData();
})

const ShowData = ()=>{
    axios({
        method:'get',
        url:'http://localhost:62821/api/Default/LoginShow',
    })
    .then(res=>{
        console.log(res.data)
        Show.value = res.data;
    })
    .catch(err=>{
        console.log(err)
    })
}

</script>
